
import logging

from base_service import BaseService


class StudentService(BaseService):
  def __init__(self, user):
    super(StudentService, self).__init__(user)

  def getStudents(self, request):
    students = self.student_client.getStudentsForWeb()
    return {'students': students}

  def saveFacebookProfile(self, request):
    self.student_client.saveFacebookProfile(
        self.student_client.getStudentIdForUser(self.user),
        request['profile'])
    return {}

  def saveFacebookFriends(self, request):
    self.student_client.saveFacebookFriends(
        self.student_client.getStudentIdForUser(self.user),
        request['fb_friends'],
        request['fb_matches'])
    return {}

  def saveStudentConsent(self, request):
    self.student_client.saveStudentConsent(
        self.student_client.getStudentIdForUser(self.user),
        request['consented'])
    return {}

  def saveStudentStatus(self, request):
    self.student_client.saveStudentStatus(
        self.student_client.getStudentIdForUser(self.user),
        request['status'])
    return {}
